﻿using ccgstore.WebApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ccgstore.WebApp.Controllers
{
    public class UserController : ControllerBase
    {
        readonly CcgStoreRepository _ccgStoreRepository;

        public UserController()
        {
            _ccgStoreRepository = new CcgStoreRepository();
        }

        //
        // GET: /User/
        [Authorize]
        public ActionResult Index()
        {
            return View(_ccgStoreRepository.GetAllUsers());
        }

        [HttpGet]
        [Authorize]
        public ActionResult Edit(int id)
        {
            var user = _ccgStoreRepository.GetUser(id);

            return View(user);
        }
    }
}
